﻿#include "SqlOper.h"

SqlOper::SqlOper()
{
}


SqlOper::~SqlOper()
{
}

bool SqlOper::initSql(CDataBaseConfig * pStDbCfg)
{
	m_pDatabaseOperMgr = new CDatabaseOperMgr();
	m_pDatabaseOperMgr->setConnectNumber(5, 5);
	return m_pDatabaseOperMgr->setDbConfigInfo(*pStDbCfg, pStDbCfg->vecTableName);
}

void SqlOper::startWork(int nTime)
{
	m_pDatabaseOperMgr->StartWorkThread(nTime);
}

void SqlOper::stopWork()
{
	m_pDatabaseOperMgr->StopWorkThread();
}

bool SqlOper::exec(CDatabaseExecData & data, const int & nLock)
{
	return m_pDatabaseOperMgr->exec(data, nLock);
}



SQLOPER_EXPORT ISqlOper * createISqlOper()
{
	SqlOper *pSqlOper = new SqlOper();
	return pSqlOper;
}
